<?xml version="1.0" encoding="utf-8"?>
<taskrunner name="install.vida" version="1.1" date="2013-10-25" maxthreads="1">
  <!--
		Change Log:
			2000-02-14 : teriks28 : QC9612 added param x64, added param x64 in call to script "vida.install.dot.net.xml"
			2011-02-17 : teriks28 : CR3369 CWLOfflineEAR.ear
                          Added task "Copy.CwlOffline.ear"
			2013-10-08 : teriks28 : WAS8 project
					Removed task "config.mssql.xml". We don´t have to create this file any more it will be cheked in at the correct location
					Changed value for task "change.attributes" from "${target.vidaear.dir}\VidaWeb.war\Diagnostics" to "${target.vidaweb.dir}\Diagnostics"
					Changed value for task "create.image.update.folder" from "${target.vidaear.dir}\VidaWeb.war\DataImages" to "${target.vidaweb.dir}\DataImages"
  -->

  <includes>
    <file name="vida.install.settings.xml" />
  </includes>

  <parameters>
    <parameter name="request.x64" value="input#"/>
  </parameters>

  <tasks>
    <task name="kill.vidamonitor">
      <description>
        Kills VidaMonitor.exe
      </description>
      <dependencies list=""/>
      <subtasks filename="vida.kill.vidamonitor.xml"/>
    </task>

    <task name="delete.jboss">
      <description>
        Deletes the jboss folder.
      </description>
      <dependencies list="kill.vidamonitor"/>
      <subtasks filename="vida.remove.jboss.xml"/>
    </task>

    <task name="copy.application" typename="@DirectoryCopy">
      <dependencies list="delete.jboss,kill.vidamonitor"/>
      <parameters>
        <parameter name="src" value="${install.src.application.dir}"/>
        <parameter name="dst" value="${target.application.dir}"/>
      </parameters>
    </task>

    <task name="unzip.jboss.package" typename="@UnZip">
      <dependencies list="delete.jboss,copy.application"/>
      <parameters>
        <parameter name="filename" value="${install.src.jboss.zip.fullpath}"/>
        <parameter name="outputdirectory" value="${target.application.dir}"/>
      </parameters>
    </task>

    <task name="copy.vida.ear" typename="@DirectoryCopy">
      <dependencies list="unzip.jboss.package"/>
      <parameters>
        <parameter name="src" value="${install.src.vidaear.dir}"/>
        <parameter name="dst" value="${target.vidaear.dir}"/>
      </parameters>
    </task>

    <task name="Copy.CwlOffline.ear" typename="@DirectoryCopy">
      <dependencies list="copy.vida.ear"/>
      <parameters>
        <parameter name="src" value="${install.src.cwlofflineear.dir}"/>
        <parameter name="dst" value="${target.cwlofflineear.dir}"/>
      </parameters>
    </task>

    <task name="change.attributes" condition="¤{root.dir.exists}=true" typename="@CommandLine">
      <description>
				Removes the attribute read-only on all files in the dvdinput directory.
      </description>
      <dependencies list="copy.application,copy.vida.ear,Copy.CwlOffline.ear"/>
      <parameters>
        <parameter name="arguments" value="attrib -r /s"/>
				<parameter name="workingdirectory" value="${target.vidaweb.dir}\Diagnostics"/>
        <parameter name="useCmdExe" value="true"/>
      </parameters>
    </task>
  
    <task name="diag.install">
      <dependencies list="copy.vida.ear,Copy.CwlOffline.ear"/>
      <subtasks filename="vida.install.dot.net.xml">
        <parameters>
          <parameter name="request.x64" value="${request.x64}"/>
        </parameters>
      </subtasks>        
    </task>

    <task name="create.image.update.folder" typename="@CreateDirectory">
      <dependencies list="diag.install"/>
      <parameters>
				<parameter name="directory" value="${target.vidaweb.dir}\DataImages"/>
      </parameters>
    </task>

    <task name="create.install.root.file" typename="@CreateFile">
      <description>
        This file is needed for uninstall.
      </description>
      <parameters>
        <parameter name="filename" value="${target.root}\${root.dir.file.marker}"/>
        <parameter name="text" value="Per Aspera Ad Astra"/>
        <parameter name="append" value="true"/>
      </parameters>
    </task>
  </tasks>

</taskrunner>
